using UnityEngine;
using QFramework;

namespace QFramework.Monk
{
	public partial class Bomb : GameEntityObj
	{
		void Start()
		{
			// Code Here
		}
		private void OnTriggerEnter2D(Collider2D other)
		{
			if (other.gameObject.layer== LayerMask.NameToLayer("Player"))
			{

				AudioKit.PlaySound("bomb");
				foreach (var enemy in FindObjectsByType<EnemyBase>(FindObjectsInactive.Exclude,FindObjectsSortMode.None))
				{
					enemy.CostHp(10);
				}
				UINormal.bombEvent.Trigger();
				CameraController.Default.Shake(30,0.2f);
				
				this.gameObject.DestroySelfGracefully();
			}
		}
	}
}
